package com.springDemo.JDBC.dao;

import com.springDemo.JDBC.entity.UserModel;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

/**
 * Created by Administrator on 2016/7/20.
 */
public class UserJdbcDaoImpl extends SimpleJdbcDaoSupport implements IUserDao {

    private static final String INSERT_SQL = " insert into sys_user(username,password,name) value(:username,:password,:name)";

    public void insertUser(UserModel user) {
        getSimpleJdbcTemplate().update(INSERT_SQL, new BeanPropertySqlParameterSource(user));
    }

    public int countAll() {
        return 0;
    }
}
